﻿define(
    ['services/dataservice.cabinet', 'model.mapper/model.mapper.product', 'repositories/repository.entitySet'],
    function (dataservice, mapper, entitySet) {
    	
        var cabinet = new entitySet(dataservice.getCabinets, mapper);

        cabinet.getCabinets = function (options) {
    		return $.Deferred(function (def) {
    		    $.when(cabinet.getData(options, dataservice.getCabinets))
                    .done(function () {
                        def.resolve();
                    })
                    .fail(function () {
                        def.reject();
                    });
    		}).promise();
    	};    
        return cabinet;
    });